package com.hc.sp02.item.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import sp01.pojo.Item;
import sp01.service.ItemService;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Z
 * @DATE 2021/8/30 14:41
 * @e-mail ...@qq.com
 */
@Service
@Slf4j    // 日志
public class ItemServiceImpl implements ItemService {
    @Override
    public List<Item> getItems(String orderId) {
        List<Item> list = new ArrayList<>();
        list.add(new Item(1,"商品1",4));
        list.add(new Item(2,"商品2",4));
        list.add(new Item(3,"商品3",4));
        list.add(new Item(4,"商品4",4));
        list.add(new Item(5,"商品5",5));
        list.add(new Item(6,"商品6",6));
        return list;
    }

    @Override
    public void decreaseNumbers(List<Item> list) {
        for (Item item:list){
            log.info("减少商品库存"+item);
        }
    }
}
